package day240918.lambda.demo;

public class Test {
    public static void main(String[] args) {
        method1();
    }

    public static void method2() {
        //MyClass myClass=()->{};
    }

    public static void method1() {
        MyClass myClass = new MyClass() {
            @Override
            void doSomething() {
                System.out.println("匿名类方式实现");
            }
        };

        myClass.doSomething();
    }
}
